package com.pine.common.beans.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 基础查询请求体
 * </p>
 *
 * @author pine manage
 * @since 2024-08-09
 */
@Data
@Schema(title = "SuperQueryRequest", description = "基础查询请求体")
public class SuperQueryRequest implements Serializable {
    @Serial
    private static final long serialVersionUID = -1236459474909424379L;

    /**
     * 排序字段&排序类型
     * <p>
     * 比如，对id字段asc排序并且对code字段进行desc排序，传递为<code>id-asc,code-desc</code>
     * </p>
     */
    @JsonProperty("orderBy")
    @Schema(title = "orderBy", description = "排序字段&排序类型", examples = {"id-asc", "code-desc", "id-asc,code-desc"})
    private String orderBy;

    /**
     * 查询字段
     */
    @JsonProperty("fields")
    @Schema(title = "fields", description = "查询字段，不传时会默认查全部可查询的字段；传递了字段，仅会查询并返回对应字段", example = "code,name,status")
    private String fields;
}
